 <div class="container">

<?php
if (empty($datalist)) {
	echo "<h3>Data masih kosong!</h3>";
}
else {
?>
			<table id="my_data_list" class="table table-striped table-bordered" cellspacing="0" width="100%">
				<thead>
					<tr>
						<th>NIK</th>
						<th>Departemen</th>
						<th>Checklist Safety Patrol</th>
						<th>Laporan Hasil Pemeriksaan Bulanan</th>
						<th>Laporan Fasilitas K3</th>
						<th>Kartu Stop</th>
					</tr>
				</thead>
				<tbody>
				<?php
				
				$no = 1;
				//print_r($datalist);
				//echo $datalist[0]['anggota'];
				
				foreach ($datalist as $key => $value) {
					$return[$value['anggota']][] = $value['departemen'];
					
					if(empty($value['data1']))
					{
					$return[$value['anggota']][] = "";
					}
					else
					{
					$return[$value['anggota']][] = $value['data1'];
					}
					
					if(empty($value['data2']))
					{
					$return[$value['anggota']][] = "";
					}
					else
					{
					$return[$value['anggota']][] = $value['data2'];
					}
					
					if(empty($value['data3']))
					{
					$return[$value['anggota']][] = "";
					}
					else
					{
					$return[$value['anggota']][] = $value['data3'];
					}
					
					if(empty($value['data4']))
					{
					$return[$value['anggota']][] = "";
					}
					else
					{
					$return[$value['anggota']][] = $value['data4'];
					}
				}

				foreach ($return as $key => $value) {
				?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $value[0]; ?></td>
						<?php
						if($value[1])
						{
						?>
						<td><input name="status" type="checkbox" checked disabled /></td>
						<?php
						}
						else
						{
						?>
						<td><input name="status" type="checkbox" disabled /></td>
						<?php
						}
						?>
						<?php
						if($value[2])
						{
						?>
						<td><input name="status" type="checkbox" checked disabled /></td>
						<?php
						}
						else
						{
						?>
						<td><input name="status" type="checkbox" disabled /></td>
						<?php
						}
						?>
						<?php
						if($value[3])
						{
						?>
						<td><input name="status" type="checkbox" checked disabled /></td>
						<?php
						}
						else
						{
						?>
						<td><input name="status" type="checkbox" disabled /></td>
						<?php
						}
						?>
						<?php
						if($value[4])
						{
						?>
						<td><input name="status" type="checkbox" checked disabled /></td>
						<?php
						}
						else
						{
						?>
						<td><input name="status" type="checkbox" disabled /></td>
						<?php
						}
						?>
					</tr>
				<?php
				}
				?>
				<?php
				/*$no = 1;
				//print_r($datalist);
				//echo $datalist[0]['anggota'];
				
				foreach ($datalist as $key => $value) {
					$return[$value['anggota']][] = $value['departemen'];
				}

				foreach ($return as $key => $value) {
				?>
					<tr>
						<td><?php echo $key; ?></td>
						<td><?php echo $value[0]; ?></td>
						<td><?php echo count($value); ?></td>
					</tr>
				<?php
				}
				*/
				/*foreach ($datalist as $data):
				?>
					<tr>
						<td><?php echo $data['anggota']; ?></td>
						<td><?php echo $data['departemen']; ?></td>
						<td><?php echo ""; ?></td>
					</tr>
				<?php
				$no++;
				endforeach;*/
				?>
				</tbody>
			</table><?php } ?>
		</div></body></html>